﻿using System;
using UnityEngine;

namespace EditorFrameWork
{
    public abstract class GUIBase: IDisposable
    {
        protected bool m_Disposed { get; private set; }
        protected  Rect mPosition { get;  set; }
        public virtual void OnGUI(Rect position)
        {
            mPosition = position;
        }

        public virtual void Dispose()
        {
            if (m_Disposed) return;
            OnDispose();
            m_Disposed = true;
        }

        protected abstract void OnDispose();
    }
}